set(Pjt_name tensorflowCCVisionLib) 
cmake_minimum_required(VERSION 3.2) 
find_package(OpenCV REQUIRED)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g -std=c++11 -W")
aux_source_directory(SOURCE_FILE .)

set(Eigen_include_DIR /usr/local/include/eigen3) #3.3.5
set(Eigen_lib_DIR /usr/local/lib)
set(ABSL_DIR /usr/local/tensorflow/downloads/absl) #下载目录  
set(Protobuf_DIR /usr/local)  #3.6.0
set(tesnsorflow_DIRS /usr/local/tensorflow)

# SET_TARGET_PROPERTIES(${Pjt_name} PROPERTIES VERSION 1.2 SOVERSION 1)        #设置动态库版本号

include_directories(${Pjt_name}
    ${tesnsorflow_DIRS}/include
    # ${Eigen_include_DIR} 
    ${ABSL_DIR} 
    ${Protobuf_DIR}/include
    .
    linemod_before
    /opt/ros/kinetic/include/opencv-3.3.1-dev
    # /home/de/work/tensorflow #tensorflow 原有
    # /home/de/work/tensorflow/bazel-genfiles #bazel 编译的时候生成
)



link_directories(${Pjt_name}
    # ${Eigen_lib_DIR} 
    ${Protobuf_DIR}/lib
    # ${tesnsorflow_DIRS}/lib  #原来的不带有AVE 指令加速
    /home/de/tensorflow_cc_sse #带有AVE 指令加速
    /usr/local/lib
    # /home/de/work/tensorflow/bazel-bin/tensorflow #bazel 编译的时候生成
    /build
    /opt/ros/kinetic/lib/x86_64-linux-gnu
) 

add_definitions(-std=c++11)
ADD_LIBRARY(tensorflowCCVisionLib SHARED ${Pjt_name})
target_link_libraries(${Pjt_name}  -ltensorflow_cc -ltensorflow_framework -lprotoc)
# 安装编译完成后的安装默认路径
install(TARGETS tensorflowCCVisionLib LIBRARY DESTINATION BuildLib)


